﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SharpHomeEngine
{

    public class Request4TagStateChange : Request4Tag
    {
        internal Request4TagStateChange(Controller Controller, Tag Tag, object Value)
            : base(Controller, Tag)
        {
            this.objValue = Value;
        }

        //internal RequestTagStateChange(Controller Controller, String Address, object Value)
        //    : base(Controller, Address)
        //{
        //    this.objValue = Value;
        //}

        public override void Complete(bool Completed, bool Sucessful)
        {
            if (Completed && Sucessful)
            {
                Tag.SetValue(Value);
            }
            Engine.RaiseStateChangeCompletedEvent(this);
            base.Complete(Completed, Sucessful);
        }
    }
}
